<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <title></title>
    <script src="js/jquery.min.js"></script>
    <script src="js/md5.js"></script>
    <script src="js/sha1.js"></script>
    <script src="js/config.js"></script>
    <link rel="stylesheet" href="css/find_pwd.css"/>
</head>
<body>
<div class="top_input"><input type="text"/></div>
<input type="tel" class="phone"/>
<input type="password" class="new_pwd"/>
<input type="text" class="pwd"/>
<div class="next"></div>
<div class="getyzm"></div>
<div class="back_index" style="pointer-events:none">返回登录</div>
<!--提示弹框-->
<div class="pop_tip"></div>
<script>
    function tip(msg) {
        $(".pop_tip").show().text(msg);
        setTimeout(function () {
            $(".pop_tip").slideUp(500);
        }, 1000)
    }
    setTimeout(function () {
        $('.back_index').css('pointer-events','auto')
    },1500)
    $('input[type!="checkbox"]').off('focus').on('focus', function () {
        var _self=$(this);
        var ty=$(this).attr('type');
        $('.top_input').show();
        if(ty=='password'){
            $('.top_input input').attr('type',ty)
        }
        $('.top_input input').val(_self.val())
        $('.top_input input').focus();
        $('.top_input input').off('blur').on('blur', function () {
            var v=$('.top_input input').val();
            _self.val(v)
            $('.top_input').hide();
            $('.top_input input').attr('type','text')
        })
        $('.top_input input').off('keydown').on('keydown', function (e) {
            var key= e.which;
            if(key==13){
                var v=$('.top_input input').val();
                _self.val(v)
                $('.top_input').hide();
                $('.top_input input').attr('type','text')
            }
        })
    })
    $('.back_index').off('touchstart').on('touchstart', function () {
        window.location.href = 'login.html'
    })
    $('.getyzm').off('touchstart').on('touchstart', function () {
        var tel=$('.phone').val()
            getData({url:getcode,data:{mobile:tel,type:5}}, function (data) {
                tip(data.info)
            })
    })
    $('.next').off('touchstart').on('touchstart', function () {
        var  mobile=$('.phone').val();
        var  new_pwd=$('.new_pwd').val();
        var yzm=$('.pwd').val()
        getData({url:fogetpwd,data:{mobile:mobile,loginpwd:new_pwd,code:yzm}}, function (data) {
                tip(data.info);
                if(data.msg=='success'){
                    setTimeout(function () {
                        window.location.href='login.html';
                    },2000)
                }
        })
    })
</script>
</body>
</html>